package com.itheima.controller;

import com.itheima.common.CommonResult;
import com.itheima.service.DishService;
import com.itheima.vo.DishVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/dish")
public class ClientDishController {
    @Autowired
    private DishService dishService;
    @GetMapping("/list")
    public CommonResult clientGetList(String categoryId,Integer status,
                                      @RequestParam(defaultValue = "1") Integer page,
                                      @RequestParam(defaultValue = "10") Integer pageSize){
        List<DishVo> dishVos = dishService.clientGetList(categoryId, status, page, pageSize);
        return CommonResult.success(dishVos);
    }
}
